import request from "@/api";

// 新增用户
// 查询用户列表
export function login(data) {
  return request({
    url: "/login",
    method: "post",
    data: data,
    headers: {
      userName: data.userName,
    },
  });
}

export function logout(data) {
  return request({
    url: "/logout",
    method: "post",
    data: data,
  });
}

export function listUser(data) {
  return request({
    url: "/ydlUser",
    method: "get",
    params: data,
  });
}

export function getInfo(data) {
  return request({
    url: "/ydlUser/getInfo",
    method: "get",
    params: data,
  });
}

export function getById(id) {
  return request({
    url: "/ydlUser/" + id,
    method: "get",
  });
}

export function addUser(data) {
  return request({
    url: "/ydlUser",
    method: "post",
    data: data,
  });
}
export function editUser(data) {
  return request({
    url: "/ydlUser",
    method: "put",
    data: data,
  });
}
export function deleteById(id) {
  return request({
    url: "/ydlUser/" + id,
    method: "delete",
  });
}
